package com.cuit.jifver.weibo.data;

import java.util.List;

import android.content.Context;

import com.cuit.jifver.weibo.model.HomeTimeLineRequest;
import com.cuit.jifver.weibo.model.TextMessage;
import com.cuit.jifver.weibo.model.WeiBoList;
import com.cuit.jifver.weibo.utils.ConfigUtil;

public abstract class Weibo
{
	private static Weibo mWeiboInstance = null;	
	private String accessToken = null;
	private String accessSecret = null;
	public Weibo()
	{
		
	}
	
	
	
	
	public static Weibo getInstance() 
	{
		if (mWeiboInstance == null) 
		{
			String weibo = ConfigUtil.getInstance().getCurWeibo();
			if (weibo.equals(ConfigUtil.QQW))
			{
				mWeiboInstance = new QqWeibo();
			}
			else  if (weibo.equals(ConfigUtil.SINAW))
			{
				mWeiboInstance = new SinaWeibo();
			}			
		}
		else
		{
			String weibo = ConfigUtil.getInstance().getCurWeibo();
			if (weibo.equals(ConfigUtil.QQW) &&  !(mWeiboInstance instanceof QqWeibo))
			{
				mWeiboInstance = new QqWeibo();
			}
			else  if (weibo.equals(ConfigUtil.SINAW) && !(mWeiboInstance instanceof SinaWeibo))
			{
				mWeiboInstance = new SinaWeibo();
			}	
			
		}
		return mWeiboInstance;
	}
	public abstract String publishTextMessage(Context context,TextMessage message);
	public abstract Object getHomeTimeLine(Context context,HomeTimeLineRequest request);
	
	
	
	public String getAccessToken()
	{
		return accessToken;
	}
	public void setAccessToken(String accessToken)
	{
		this.accessToken = accessToken;
	}
	public String getAccessSecret()
	{
		return accessSecret;
	}
	public void setAccessSecret(String accessSecret)
	{
		this.accessSecret = accessSecret;
	}
	
	
	
}
